package com.haixiaoke.saas.lock.service.impl;

import com.haixiaoke.saas.common.utils.DateUtils;
import com.haixiaoke.saas.lock.domain.LockFreezeLog;
import com.haixiaoke.saas.lock.mapper.LockFreezeLogMapper;
import com.haixiaoke.saas.lock.service.ILockFreezeLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 锁冻结记录Service业务层处理
 *
 * @author qixi
 * @date 2024-08-05
 */
@Service
public class LockFreezeLogServiceImpl implements ILockFreezeLogService {
    @Autowired
    private LockFreezeLogMapper lockFreezeLogMapper;

    /**
     * 查询锁冻结记录
     *
     * @param freezeLogId 锁冻结记录主键
     * @return 锁冻结记录
     */
    @Override
    public LockFreezeLog selectLockFreezeLogByFreezeLogId(Long freezeLogId) {
        return lockFreezeLogMapper.selectLockFreezeLogByFreezeLogId(freezeLogId);
    }

    /**
     * 查询锁冻结记录列表
     *
     * @param lockFreezeLog 锁冻结记录
     * @return 锁冻结记录
     */
    @Override
    public List<LockFreezeLog> selectLockFreezeLogList(LockFreezeLog lockFreezeLog) {
        return lockFreezeLogMapper.selectLockFreezeLogList(lockFreezeLog);
    }

    /**
     * 新增锁冻结记录
     *
     * @param lockFreezeLog 锁冻结记录
     * @return 结果
     */
    @Override
    public int insertLockFreezeLog(LockFreezeLog lockFreezeLog) {
        lockFreezeLog.setCreateTime(DateUtils.getNowDate());
        return lockFreezeLogMapper.insertLockFreezeLog(lockFreezeLog);
    }

    /**
     * 批量删除锁冻结记录
     *
     * @param freezeLogIds 需要删除的锁冻结记录主键
     * @return 结果
     */
    @Override
    public int deleteLockFreezeLogByFreezeLogIds(Long[] freezeLogIds) {
        return lockFreezeLogMapper.deleteLockFreezeLogByFreezeLogIds(freezeLogIds);
    }

    /**
     * 删除锁冻结记录信息
     *
     * @param freezeLogId 锁冻结记录主键
     * @return 结果
     */
    @Override
    public int deleteLockFreezeLogByFreezeLogId(Long freezeLogId) {
        return lockFreezeLogMapper.deleteLockFreezeLogByFreezeLogId(freezeLogId);
    }

    @Override
    public int batchInsertLockFreezeLog(List<LockFreezeLog> lockFreezeLogList) {
        return lockFreezeLogMapper.batchInsertLockFreezeLog(lockFreezeLogList);
    }
}
